/**     
* @Title: ${modelNameUpperCamel}Controller.java
* @Package ${basePackageController}
* @Description: TODO
* @author ${author} 
* @date ${date}
* @version V1.0     
*/
package ${basePackageController};

import ${basePackageModel}.${modelNameUpperCamel};
import ${basePackageService}.${modelNameUpperCamel}Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**   
* @ClassName: ${modelNameUpperCamel}Controller   
* @Description: TODO
* @author ${author}
* @date ${date}
*/
@Controller
@RequestMapping("${baseRequestMapping}")
public class ${modelNameUpperCamel}Controller {

    @Resource
    private ${modelNameUpperCamel}Service ${modelNameLowerCamel}Service;

    /**
    * @Title: detail   
    * @Description: 详情
    * @param model
    * @param id
    * @Reutrn String
    */
    @RequestMapping("/detail")
	public String detail(Map<String, Object> model, @RequestParam Integer id) {
		${modelNameUpperCamel} ${modelNameLowerCamel} = ${modelNameLowerCamel}Service.findById(id);
		model.put("${modelNameLowerCamel}", ${modelNameLowerCamel});		
		return "${baseRequestMappingStartWithNoSlash}/detail";
	}

    /**
    * @Title: page   
    * @Description: 分页查询
    * @param model 
    * @param page 页码
    * @param size 每页条数
    * @Reutrn String
    */
    @RequestMapping("/list")
    public String page(Map<String, Object> model, @RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size) {
        PageHelper.startPage(page, size);
        List<${modelNameUpperCamel}> list = ${modelNameLowerCamel}Service.findAll();
        PageInfo<${modelNameUpperCamel}> pageInfo = new PageInfo<${modelNameUpperCamel}>(list);
        model.put("pageList", pageInfo);
        return "${baseRequestMappingStartWithNoSlash}/list";
    }  
}